package com.chj.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.chj.entity.Order;
import com.chj.util.ResultSetUtil;
import com.etc.jdbc.mapper.RowMapper;

public class OrderMapper implements RowMapper<Order> {

    @Override
    public Order mapRow(ResultSet rs) throws SQLException {

        Order order = new Order();

        order.setOrderPk(ResultSetUtil.getString(rs, "order_pk"));//order_pk;
        order.setOrderId(ResultSetUtil.getString(rs, "order_id"));//order_id;
        order.setUserId(ResultSetUtil.getString(rs, "user_id"));//user_id;
        order.setEcarId(ResultSetUtil.getString(rs, "ecar_id"));//ecar_id;
        order.setNetworkId(ResultSetUtil.getString(rs, "network_id"));//network_id;
        order.setParkId(ResultSetUtil.getString(rs, "park_id"));//park_id;
        order.setParkPrice(ResultSetUtil.getBigDecimal(rs, "park_price"));//park_price;
        order.setParkPayMoney(ResultSetUtil.getBigDecimal(rs, "park_pay_money"));//park_pay_money;
        order.setOrderStatus(ResultSetUtil.getInt(rs, "order_status"));//order_status;
        order.setCompleteStatus(ResultSetUtil.getInt(rs, "complete_status"));//complete_status;
        order.setPayStatus(ResultSetUtil.getInt(rs, "pay_status"));//pay_status;
        order.setPayDate(ResultSetUtil.getDate(rs, "pay_date"));//pay_date;
        order.setOrderBeginTime(ResultSetUtil.getDateTime(rs, "order_begin_time"));//order_begin_time;
        order.setOrderEndTime(ResultSetUtil.getDateTime(rs, "order_end_time"));//order_end_time;
        order.setOrderTimeLong(ResultSetUtil.getBigDecimal(rs, "order_time_long"));//order_time_long;
        order.setOrderPaysuccessId(ResultSetUtil.getString(rs, "order_paysuccess_id"));//order_paysuccess_id;
        order.setOrderCallbackId(ResultSetUtil.getString(rs, "order_callback_id"));//order_callback_id;
        order.setCreateDate(ResultSetUtil.getDate(rs, "create_date"));//create_date;
        order.setModifyDate(ResultSetUtil.getDate(rs, "modify_date"));//modify_date;
        order.setDeleteDate(ResultSetUtil.getDate(rs, "modify_date"));//modify_date;
        order.setStatus(ResultSetUtil.getInt(rs, "status"));//status;

        return order;
    }
    

}
